﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Content_View_Admin_HienThiTuVung : System.Web.UI.Page
{
    BangTinNhan btn = new BangTinNhan();
    protected void Page_Load(object sender, EventArgs e)
    {
        GVBangTin.DataSource = btn.Load_BTNhan();
        GVBangTin.DataBind();
    }
    protected void GVBangTin_RowEditing(object sender, GridViewEditEventArgs e)
    {
        string MaTin = GVBangTin.DataKeys[e.NewEditIndex].Value.ToString();
        Session["MaTin"] = MaTin;
        MultiView1.ActiveViewIndex = 1;

    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        MultiView1.ActiveViewIndex = 2;
    }
    protected void Button2_Click(object sender, EventArgs e)
    {

        //cau lenh update
    }
    protected void MultiView1_ActiveViewChanged(object sender, EventArgs e)
    {
        if (MultiView1.ActiveViewIndex == 1)
        {
            string matin = (string)Session["Matin"];
            if (matin != null)
            {
                FormView1.DataSource = btn.HienThiTenNgGui(matin);
                FormView1.DataBind();
                
                
            }

        }
    }
    protected void FormView1_ItemCommand(object sender, FormViewCommandEventArgs e)
    {
        if (e.CommandName == "update")
        {
            //luu chinh sua
        }
    }

    protected void LinkButton2_Click(object sender, EventArgs e)
    {
        MultiView1.ActiveViewIndex = 0;
    }
}
